<?php
/**
 * OntoWiki Client Search Template
 *
 * @author Feng Qiu <Qiu_Feng39@hotmail.com>
 * @version $Id: search.phtml 2769 2009-04-06 14:57:58Z norman.heino $
 */
?>


<?php $to_translate = $this->escape($this->to_translate);?>
<?php $this->placeholder('search.box.content')->captureStart() ?>
<form method="post" action="<?php echo $to_translate;?>">
	<fieldset>
	Search:
		<p class="width99">
		<input class="inner-label text width100 live-search" type="text" id="id_key_word" name="key_word" value="Type to search..."/>
		</p>
		in:
		<div class="no-min-width">
			<select name="search_about" class="width99" id="id_search_about">
				<option value="all">All</option>    
				<option value="name">Plugin name</option>
				<option value="developer">Developer</option>
				<option value="categorie">Categories</option>
			</select>
	</div>
	</fieldset>
	<div><button type="submit" name="submit"><?php echo $this->_('Submit') ?></button></div>
</form>
<?php $this->placeholder('search.box.content')->captureEnd() ?>

<?php $this->placeholder('main.window.innerwindows')->append(
	$this->partial('partials/window.phtml', array(
		'headinglevel' => 2, 
		'title'        => $this->_('Search Engine'), 
		'content'      => $this->placeholder('search.box.content'), 
		'cssClasses'   => '', 
		'cssId'        => ''
	))
);?>




<?php $results = $this->results;?>
<?php if (count($this->paginator)):?>
<?php
	$pic_url = $this->pluginurl."templates/plugins/pic/";
	$logo = $pic_url."plugin_logo.gif";
	$theme = $pic_url."categorie_theme.png";	
	if (isset($results)) {
		$i = 1;	// to create id for each plugin
		foreach ($this->paginator as $result) {
				$pName = $result['name'];
				$developer = $result['developer'];
				$description = $result['description'];
				$s_plugin_id = "plugin_".$i."_s";		//selected plugin_id
				$u_plugin_id = "plugin_".$i;		// unselected plugin_id
				$i++;
				echo<<<showResults
					<div class="qiufeng_template">
						  <div class="plugin_selected" id="$s_plugin_id" >
								<div class="left_window">
									<img src="$theme" alt="categorie" width="50" height="50"/>		
								</div>
							<div class="right_window">
								<div class="title_window">
									<p class="plugin_title">$pName</p>
								</div>
								<div class="logo_window">
									<img src="$logo" alt="logo_window" width="80" />			
								</div>
								<div class="description_window">
									$description			
								</div>		
								<div class="install_window">
								  <div class="author">$developer</div>	  
								  <input type="button" value="Install" class="install" />
								</div>
							</div>       
						  </div>
						  
						
						  <div class="plugin_unselected" id="$u_plugin_id" onclick="select_plugin('$u_plugin_id')">
								<div class="left_window">
									<img src="$logo" alt="categorie" width="50" height="38" border="1px" />		</div>
							<div class="right_window">
								<div class="title_window">
									<p class="plugin_title">$pName</p>
								</div>
								<div class="description_window">
									$description		
								</div>...		
								
							</div>      
						  </div>
					</div>
				
showResults;
					
		}
	}?>
<?= $this->paginationControl($this->paginator, 'Elastic', '/pagelist/categoriepagelist.phtml'); ?>





<?php endif; ?>